<!DOCTYPE html>
<html>
<head>
<title>操作日志</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<#include "../../../include/resources.html">
<script type="text/javascript">
    var dataGrid;
    var winWidth =  700;
    var winHeight = 500;
    var logTitle = "系统操作日志查看";
	var logUrl = "/modules/system/sconfig/logPage.html";
    $(function() {
        dataGrid = $('#dataGrid').datagrid({
            url : 'logList.html',
            fit : true,
            fitColumns : true,
            border : false,
            pagination : true,
            idField : 'id',
            pageSize : 20,
            pageNums :1,
            pageList : [ 20, 30, 40, 50 ],
            sortName : 'id',
            sortOrder : 'asc',
            checkOnSelect : false,
            selectOnCheck : false,
            nowrap : false,
			singleSelect:true,
            columns : [ [
				{ field: 'id', title: '编号', width: 60,fixed:true,  sortable:false},
				{ field: 'type', title: '日志类型', width: 80, sortable:false,
					  formatter: function(value,row,index){
				  	  if (value == 1) {
				  		  return "接入日志";
				  	  } else if (value == 2) {
				  		  return "错误日志";
				  	  } else {
				  		  return "操作日志";
				  	  }
					 }  
				},
				{ field: 'addUser', title: '创建者', width: 80, sortable:false },
              { field: 'addTime', title: '创建时间', width: 160, sortable:false ,
            	  formatter: function(value,row,index){
  					if (row.addTime){
  						return getLocalTime(value,4);
  					} else {
  						return value;
  					}
  				  }  
              },
              { field: 'remoteAddr', title: 'IP', width: 125, sortable:false },
              { field: 'requestUri', title: '请求URI', width: 200, sortable:false },
              { field: 'method', title: '操作方法', width: 100, sortable:false },
              { field: 'params', title: '操作提交的数据', width: 200, sortable:false ,
            	  formatter: function(value,row,index){
	            	  var params = row.params;
	            	  if(params != null && params.length > 20){
            			  //return params.substring(0,20)+'...';
						  return '<div class="j-showToolTip" title="' + params + '">' + params.substring(0,20)+'...' +'</div>';
	            	  }
					  return params;
	    		 }
              },
              { field: 'exception', title: '内容', width: 200, sortable:false,
					formatter: function(value,row,index){
	            	  var exception = row.exception;
	            	  if(exception != null && exception.length > 20){
            			  //return exception.substring(0,20)+'...';
						  return '<div class="j-showToolTip" title="' + exception + '">' + exception.substring(0,20)+'...' +'</div>';
	            	  }
					  return exception;				  
	    		 }
              }] ],
            toolbar : '#toolbar1',
			onLoadSuccess : function() {
				/*
				parent.$.messager.progress('close');
				$(this).datagrid('tooltip');
				*/
				$('.j-showToolTip').tooltip();
			}
        });
    });
</script>
</head>
<body style="padding:0 20px;" >
    <div class="easyui-layout" data-options="fit : true,border : false">
       <div data-options="region:'north',border:false,collapsible:false" id="searchBox">
       		<div class="sLeft">
	            <form id="searchForm">
	            	日志类型：
		                <select name="type" class="type">
		                  <option value="" selected="selected">全部</option>
		                  <option value="1">接入日志</option>
		                  <option value="2">错误日志</option>
		                  <option value="3">操作日志</option>
		                </select>
		                &nbsp;&nbsp;&nbsp;&nbsp;时间：<input type="text" name="startTime" id="startTime" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'endTime\')}',readOnly:true})" class="searchTime" style="width:100px;"/>&nbsp;-&nbsp;<input type="text"  style="width:100px;" name="endTime" id="endTime" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'startTime\')}',readOnly:true})" class="searchTime"/>
		                 &nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:;" title="查询" class="sBtn" onclick="$.fn.dataGridOptions.searchFun('#searchForm');">查询</a>
                            <a href="javascript:void(0);" class="reloadIcon" onclick="dataGrid.datagrid('reload');" title="刷新" ><i class="iconfont">&#xe603;</i></a>
	            </form>
            </div>
        </div>
        <div data-options="region:'center'" style="margin-top:30px;padding-bottom:30px;">
            <table id="dataGrid"></table>
        </div>
    </div>
</body>
</html>
